<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
	<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript">
    	$(document).ready(function(){
    		set_input_keydown_event();
    		$('#sex').combobox();    		
     		$('#save').click(function (){
     		  $('#sex_val').val($('#sex').combobox('getValue'));
     		  $('#deptno_val').val($('#deptno').text());
     		  $('#workno_val').val($('#workno').text());
    		  $('#mod_clerk_form').form('submit', {
    		    url: 'modClerk.action',
    		    error:function(message){
    		    	alert('提交数据错误，服务器可能已关闭！系统返回:'+message);
    		  	},
    		    success:function(data){
    		      var a = eval('(' + data + ')');
    		      $.messager.alert('修改账户', a.message, 'info');
    		      
                  if (a.result=='0'){
                      var $tbl = $('#clerk_table');
                      var row = $tbl.datagrid('getSelected');
                      var index = $tbl.datagrid('getRowIndex',row);
                      row.name=$('#workname').val();
                      row.identifyno=$('#identifyno').val();
                      row.sexname=$('#sex').combobox('getText');
                      row.clerktypeName=$('#clerktype').combobox('getText');
                      $tbl.datagrid('refreshRow', index);
                      
                      $('#mod_clerk_detail_panel').window('close');
                  }
    		    }
    		    })
    		});

     		$('#cancel').click(function (){
     			$('#mod_clerk_detail_panel').window('close');
    		});
  		    $('#mod_clerk_detail_panel').window();
    	});
    </script>
	</head>
	<body>
	
    <div id="mod_clerk_detail_panel" collapsible="false" fit="false" shadow="false"
    	title="修改账户" resizable="false" collapsible="false" minimizable="false" 
    	maximizable="false" closable="true" closed="true" icon="icon-save" 
    	modal="true" class="jquery_window">
    	<s:form id="mod_clerk_form" action="modClerk" cssStyle="margin:20px,50px">
    		<table>
    			<tr height="28px">
    				<td><s:label value="账户机构："></s:label></td>
    				<td><s:label id="deptno"></s:label></td>
    			</tr>
    			<tr height="28px">
    				<td><s:label value="账户号："></s:label></td>
    				<td><s:label id="workno"></s:label><s:hidden name="workno" 
    					id="workno_val"></s:hidden></td>
    			</tr>
    			<tr height="28px">
    				<td><s:label value="账户姓名：" for="workname"></s:label></td>
    				<td><input id="workname" name="name" 
    					maxlength=<s:property value="%{getText('NAME_LEN')}"/> 
    					style="width:200px" class="text_field_css"></input></td>
    			</tr>
    			<tr height="28px">
    				<td><s:label value="身份证号：" for="identifyno"></s:label></td>
    				<td><input id="identifyno" name="identifyno" 
    					maxlength=<s:property value="%{getText('IDENTIFYNO_LEN')}"/>  
    					style="width:200px" class="text_field_css"></input></td>
    			</tr>
    			<tr height="28px">
    				<td><s:label value="账户性别：" for="sex"></s:label></td>
    				<td><s:textfield id="sex" valueField="sexid" textField="sexname" 
    					style="width:200px" editable="false" panelHeight="auto"></s:textfield>
    					<s:hidden id="sex_val" name="sex"></s:hidden> </td>
    			</tr>
    			<tr height="35px">
    				<td><s:label value="账户类型：" for="clerktype"></s:label></td>
    				<td><s:textfield id="clerktype" valueField="typeid" editable="false"
    					textField="typename" style="width:200px" panelHeight="auto"></s:textfield>
    					<s:hidden id="clerktype_val" name="clerktype"></s:hidden> </td>
    			</tr>
    			<tr height="35px">
    				<td colspan="2" align="center">
            			<button id="save" class="buttons_css" style="width:60px">保存</button>
            			<label style="width:20px"></label>
            			<button id="cancel" class="buttons_css" style="width:60px">返回</button>
    				</td>
    			</tr>
    		</table>
    	</s:form>
    </div>
    </body>
</html>